Skip to main content

<internal>

Index

Classes

default

default:

Provides the default project report object which stores data pertaining to all modules / files contained.

All modules are stored in the modules member variable as ModuleReports.

Various helper methods found in ModuleReport and AbstractReport help increment associated data during collection.

constructor

  • new default(moduleReports?: default[], settings?: { serializeModules: boolean } & {}): default
  • Initializes ProjectReport with default values.


    Parameters

    • optionalmoduleReports: default[]

      An array of ModuleReports for each module / file processed.

    • optionalsettings: { serializeModules: boolean } & {}

      An object hash of the settings used in generating this report via ESComplexProject.

    Returns default

adjacencyList

adjacencyList: number[][]

Stores a compacted form of the adjacency matrix. Each row index corresponds to the same report index. Each row entry corresponds to a report index. These relationships dictate the dependencies between all report ModuleReports given the source paths.

changeCost

changeCost: number

Measures the average percentage of modules affected when one module / file in the project is changed. Lower is better.

coreSize

coreSize: number

Measures the percentage of modules that are widely depended on which also depend on other modules. Lower is better.

errors

errors: any[]

Stores any analysis errors.

firstOrderDensity

firstOrderDensity: number

Measures the percentage of all possible internal dependencies that are actually realized in the project. Lower is better.

moduleAverage

moduleAverage: default

Stores the average module metric data.

modules

modules: any[] | default[]

Stores all ModuleReport data for the project sorted by the module / files srcPath.

settings

settings: { serializeModules: boolean } & {}

Stores the settings used to generate the project report.

visibilityList

visibilityList: number[][]

Stores a compacted form of the visibility matrix. Each row index corresponds to the same report index. Each row entry corresponds to a report index. These relationships dictate the reverse visibility between all report ModuleReports which may indirectly impact the given module / file.

type

  • get type(): default
  • Returns the enum for the report type.


    Returns default

clearErrors

  • clearErrors(clearChildren?: boolean): void
  • Clears all errors stored in the project report and by default any module reports.


    Parameters

    • optionalclearChildren: boolean

      (Optional) If false then class and module method errors are not cleared; default (true).

    Returns void

finalize

  • finalize(options?: { serializeModules: boolean }): default
  • Finalizes the ProjectReport. If settings.serializeModules is false output just filePath, srcPath &amp; srcPathAlias entries of modules.


    Parameters

    • optionaloptions: { serializeModules: boolean }

      (Optional) Allows overriding of ModuleReport serialization.

    Returns default

getErrors

  • getErrors(options?: { includeChildren: boolean; includeReports: boolean; query?: any }): (default | { error: default; source: string })[]
  • Gets all errors stored in the project report and by default any module reports.


    Parameters

    • optionaloptions: { includeChildren: boolean; includeReports: boolean; query?: any }

      Optional parameters.

    Returns (default | { error: default; source: string })[]

getName

  • getName(): any
  • Returns the name / id associated with this report.


    Returns any

getSetting

  • getSetting(key: string, defaultValue?: any): any
  • Returns the setting indexed by the given key.


    Parameters

    • key: string

      A key used to store the setting parameter.

    • optionaldefaultValue: any

      A default value to return if no setting for the given key is currently stored.

    Returns any

setSetting

  • setSetting(key: string, value: any): boolean
  • Sets the setting indexed by the given key and returns true if successful.


    Parameters

    • key: string

      A key used to store the setting parameter.

    • value: any

      A value to set to this.settings[key].

    Returns boolean

toFormat

  • toFormat(name: string, options?: any): string
  • Formats this ProjectReport given the type.


    Parameters

    • name: string

      The name of formatter to use.

    • optionaloptions: any

      (Optional) One or more optional parameters to pass to the formatter.

    Returns string

staticgetFormats

  • getFormats(): string[]
  • Returns the supported transform formats.


    Returns string[]

staticparse

  • parse(object: any, options?: { skipFinalize: boolean }): default
  • Deserializes a JSON object representing a ProjectReport.


    Parameters

    • object: any

      A JSON object of a ProjectReport that was previously serialized.

    • optionaloptions: { skipFinalize: boolean }

      Optional parameters.

    Returns default

default

default:

Provides all the averaged module metric data.

constructor

  • new default(): default
  • Initializes the default averaged module data.


    Returns default

maintainability

maintainability: number

Measures the average method maintainability index for the module / file.

methodAverage

methodAverage: default

keys

  • get keys(): string[]
  • Returns the object accessor list / keys for ModuleAverage.


    Returns string[]

default

default:

Provides the module report object which stores data pertaining to a single file / module being processed.

All ES Module classes are stored in the classes member variable as ClassReports. Methods that are not part of a class are stored as ModuleMethodReport instances in the methods member variable.

Various helper methods found in ModuleReport and AbstractReport help increment associated data during collection.

constructor

  • new default(lineStart?: number, lineEnd?: number, settings?: any): default
  • Initializes the report.


    Parameters

    • optionallineStart: number

      Start line of file / module.

    • optionallineEnd: number

      End line of file / module.

    • optionalsettings: any

      An object hash of the settings used in generating this report via ESComplexModule.

    Returns default

optionalaggregate

aggregate?: default

Stores any associated AggregateReport.

aggregateAverage

aggregateAverage: default

Stores the average module / class aggregate &amp; method metric data.

classes

classes: default[]

Stores all ClassReport data for the module.

dependencies

dependencies: never[]

Stores all parsed dependencies.

errors

errors: never[]

Stores any analysis errors.

filePath

filePath: string

Stores the file path of the module / file. The file path is only defined as supplied when processing projects.

lineEnd

lineEnd: number

Stores the end line for the module / file.

lineStart

lineStart: number

Stores the start line for the module / file.

maintainability

maintainability: number

Measures the average maintainability index for the module / file.

methodAverage

methodAverage: default

Stores just the average method metric data.

methods

methods: default[]

Stores all module ModuleMethodReport data found outside of any ES6 classes.

settings

settings: any

Stores the settings used to generate the module report.

srcPath

srcPath: string

Stores the active source path of the module / file. This path is respective of how the file is referenced in the source code itself. srcPath is only defined as supplied when processing projects.

srcPathAlias

srcPathAlias: string

Stores the active source path alias of the module / file. This path is respective of how the file is referenced in the source code itself when aliased including NPM and JSPM modules which provide a main entry. srcPathAlias is only defined as supplied when processing projects.

aggregateReport

  • get aggregateReport(): default
  • Returns the associated AggregateReport or this. Both ClassReport and ModuleReport have an aggregate AggregateReport.


    Returns default

type

  • get type(): default
  • Returns the enum for the report type.


    Returns default

clearErrors

  • clearErrors(clearChildren?: boolean): void
  • Clears all errors stored in the module report and by default any class reports and module methods.


    Parameters

    • optionalclearChildren: boolean

      (Optional) If false then class and module method errors are not cleared; default (true).

    Returns void

finalize

  • finalize(): default
  • Cleans up any house keeping member variables.


    Returns default

getErrors

  • getErrors(options?: { includeChildren: boolean; includeReports: boolean; query?: any }): (default | { error: default; source: string })[]
  • Gets all errors stored in the module report and by default any module methods and class reports.


    Parameters

    • optionaloptions: { includeChildren: boolean; includeReports: boolean; query?: any }

      Optional parameters.

    Returns (default | { error: default; source: string })[]

getName

  • getName(): string
  • Returns the name / id associated with this report.


    Returns string

getSetting

  • getSetting(key: string, defaultValue?: any): any
  • Returns the setting indexed by the given key.


    Parameters

    • key: string

      A key used to store the setting parameter.

    • optionaldefaultValue: any

      A default value to return if no setting for the given key is currently stored.

    Returns any

setSetting

  • setSetting(key: string, value: any): boolean
  • Sets the setting indexed by the given key and returns true if successful.


    Parameters

    • key: string

      A key used to store the setting parameter.

    • value: any

      A value to set to this.settings[key].

    Returns boolean

toFormat

  • toFormat(name: string, options?: any): string
  • Formats this report given the type.


    Parameters

    • name: string

      The name of formatter to use.

    • optionaloptions: any

      (Optional) One or more optional parameters to pass to the formatter.

    Returns string

staticgetFormats

  • getFormats(): string[]
  • Returns the supported transform formats.


    Returns string[]

staticparse

  • parse(object: any): default
  • Deserializes a JSON object representing a ModuleReport.


    Parameters

    • object: any

      A JSON object of a ModuleReport that was previously serialized.

    Returns default

default

default:

This is an abstract class that is not intended to be used directly. Extend it to turn your class into an enum (initialization is performed via MyClass.initEnum()).

Modified from source provided by enumify (license unlisted / public domain)

@see

constructor

  • new default(instanceProperties?: any): default
  • initEnum() closes the class. Then calling this constructor throws an exception.

    If your subclass has a constructor then you can control what properties are added to this via the argument you pass to super(). No arguments are fine, too.


    Parameters

    • optionalinstanceProperties: any

      Provides initial properties.

    Returns default

optionalname

name?: string

ordinal

ordinal: any

staticenumValues

enumValues: default[]

toString

  • toString(): string
  • Default toString() method for enum constant.


    Returns string

static[iterator]

  • [iterator](): IterableIterator<default>
  • Make enum classes iterable


    Returns IterableIterator<default>

staticenumValueOf

  • enumValueOf(name: string): default
  • Given the name of an enum constant, return its value.


    Parameters

    • name: string

      An enum name.

    Returns default

staticinitEnum

  • initEnum(arg: any): default
  • Set up the enum, close the class.


    Parameters

    • arg: any

      Either an object whose properties provide the names and values (which must be mutable objects) of the enum constants. Or an Array whose elements are used as the names of the enum constants. The values are create by instantiating the current class.

    Returns default

default

default:

Provides a wrapper for analysis errors stored in the errors array for each report type.

constructor

  • new default(severity?: string, message?: string, sourceReport?: default | default | default | default | default): default
  • Initializes an instance.


    Parameters

    • optionalseverity: string

      Provides the severity level.

    • optionalmessage: string

      Provides the error message.

    • optionalsourceReport: default | default | default | default | default

      The source report of the error.

    Returns default

lineEnd

lineEnd: number

Provides the line number where the error starts.

lineStart

lineStart: number

Provides the line number where the error starts.

message

message: string

Provides the error message.

name

name: string

Attempt to find the name then try srcPath for modules.

severity

severity: string

Provides the severity level.

type

type: any

Provides a type of report where the error is found.

toString

  • toString(): string
  • Returns a verbose string about the error.


    Returns string

staticparse

  • parse(object: any): default
  • Deserializes a JSON object representing a AnalyzeError.


    Parameters

    • object: any

      A JSON object of a AnalyzeError that was previously serialized.

    Returns default

default

default:

Provides several helper methods to work with method oriented data stored as this.aggregate in ClassReport / ModuleReport and directly in ClassMethodReport / ModuleMethodReport.

constructor

  • new default(aggregateReport?: default): default
  • If given assigns the method report to an internal variable. This is used by ClassReport and ModuleReport which stores a AggregateReport respectively in this.aggregate. This is not set when AggregateReport uses this.


    Parameters

    • optionalaggregateReport: default

      An AggregateReport to associate with this report.

    Returns default

optionalaggregate

aggregate?: default

Stores any associated AggregateReport.

aggregateReport

  • get aggregateReport(): default
  • Returns the associated AggregateReport or this. Both ClassReport and ModuleReport have an aggregate AggregateReport.


    Returns default

toFormat

  • toFormat(name: string, options?: any): string
  • Formats this report given the type.


    Parameters

    • name: string

      The name of formatter to use.

    • optionaloptions: any

      (Optional) One or more optional parameters to pass to the formatter.

    Returns string

default

default:

Provides all the averaged method metric data.

constructor

  • new default(): default
  • Returns default

cyclomatic

cyclomatic: number

Measures the average method cyclomatic complexity of the module / class.

cyclomaticDensity

cyclomaticDensity: number

Measures the average method cyclomatic density of the module / class.

halstead

halstead: default

Stores the averaged Halstead metric data.

paramCount

paramCount: number

Measures the average number of method parameters for the module / class.

sloc

sloc: { logical: number; physical: number }

Measures the average source lines of code for the module / class.


Type declaration

  • logical: number
  • physical: number

keys

  • get keys(): string[]
  • Returns the object accessor list / keys for MethodAverage.


    Returns string[]

default

default:

Provides the class report object which stores data pertaining to a single ES6 class.

Methods that are stored as ClassMethodReport instances in the methods member variable.

constructor

  • new default(name?: string, superClassName?: string, lineStart?: number, lineEnd?: number): default
  • Initializes class report.


    Parameters

    • optionalname: string

      Name of the class.

    • optionalsuperClassName: string

      Name of any associated super class.

    • optionallineStart: number

      Start line of class.

    • optionallineEnd: number

      End line of class.

    Returns default

optionalaggregate

aggregate?: default

Stores any associated AggregateReport.

aggregateAverage

aggregateAverage: default

Stores the average class aggregate &amp; method metric data.

errors

errors: any[]

Stores any analysis errors.

lineEnd

lineEnd: number

Stores the end line for the class.

lineStart

lineStart: number

Stores the start line for the class.

methodAverage

methodAverage: default

Stores the average method metric data.

methods

methods: default[]

Stores all method data.

name

name: string

The name of the class.

superClassName

superClassName: string

The name of any associated super class.

aggregateReport

  • get aggregateReport(): default
  • Returns the associated AggregateReport or this. Both ClassReport and ModuleReport have an aggregate AggregateReport.


    Returns default

type

  • get type(): default
  • Returns the enum for the report type.


    Returns default

clearErrors

  • clearErrors(clearChildren?: boolean): void
  • Clears all errors stored in the class report and by default any class methods.


    Parameters

    • optionalclearChildren: boolean

      (Optional) If false then class method errors are not cleared; default (true).

    Returns void

getErrors

  • getErrors(options?: { includeChildren: boolean; includeReports: boolean; query?: any }): (default | { error: default; source: string })[]
  • Gets all errors stored in the class report and by default any class methods.


    Parameters

    • optionaloptions: { includeChildren: boolean; includeReports: boolean; query?: any }

      Optional parameters.

    Returns (default | { error: default; source: string })[]

getName

  • getName(): string
  • Returns the name / id associated with this report.


    Returns string

toFormat

  • toFormat(name: string, options?: any): string
  • Formats this report given the type.


    Parameters

    • name: string

      The name of formatter to use.

    • optionaloptions: any

      (Optional) One or more optional parameters to pass to the formatter.

    Returns string

staticgetFormats

  • getFormats(): string[]
  • Returns the supported transform formats.


    Returns string[]

staticparse

  • parse(object: any): default
  • Deserializes a JSON object representing a ClassReport.


    Parameters

    • object: any

      A JSON object of a ClassReport that was previously serialized.

    Returns default

default

default:

Provides the module method report object which stores data pertaining to a single method / function.

constructor

  • new default(name?: string, paramNames?: string[], lineStart?: number, lineEnd?: number): default
  • Initializes module method report.


    Parameters

    • optionalname: string

      Name of the method.

    • optionalparamNames: string[]

      Array of any associated parameter names.

    • optionallineStart: number

      Start line of method.

    • optionallineEnd: number

      End line of method.

    Returns default

optionalaggregate

aggregate?: default

Stores any associated AggregateReport.

cyclomatic

cyclomatic: number

The cyclomatic complexity of the method / report.

cyclomaticDensity

cyclomaticDensity: number

The cyclomatic density of the method.

errors

errors: any[]

Stores any analysis errors.

halstead

halstead: default

Stores the Halstead data instance.

lineEnd

lineEnd: number

Stores the end line for the method.

lineStart

lineStart: number

Stores the start line for the method.

maxNestedMethodDepth

maxNestedMethodDepth: number

Stores the max nested method depth.

name

name: string

The name of the method.

optionalnestedMethods

nestedMethods?: any[]

paramCount

paramCount: number

The number of parameters for the method or aggregate report.

paramNames

paramNames: string[]

Stores any parameter names.

sloc

sloc: SLOC

The source lines of code for the method.

aggregateReport

  • get aggregateReport(): default
  • Returns the associated AggregateReport or this. Both ClassReport and ModuleReport have an aggregate AggregateReport.


    Returns default

type

  • get type(): default
  • Returns the enum for the report type.


    Returns default

clearErrors

  • clearErrors(clearChildren?: boolean): void
  • Clears all errors stored in the method report.


    Parameters

    • optionalclearChildren: boolean

      (Optional) If false then nested method errors are not cleared; default (true).

    Returns void

getErrors

  • getErrors(options?: { includeChildren: boolean; includeReports: boolean; query?: any }): (default | { error: default; source: string })[]
  • Gets all errors stored in the method report and by default any nested methods.


    Parameters

    • optionaloptions: { includeChildren: boolean; includeReports: boolean; query?: any }

      Optional parameters.

    Returns (default | { error: default; source: string })[]

getName

  • getName(): string
  • Returns the name / id associated with this report.


    Returns string

toFormat

  • toFormat(name: string, options?: any): string
  • Formats this report given the type.


    Parameters

    • name: string

      The name of formatter to use.

    • optionaloptions: any

      (Optional) One or more optional parameters to pass to the formatter.

    Returns string

static_parse

  • _parse(targetObject: default | default, jsonObject: any): default | default
  • Deserializes a JSON object representing a ClassMethodReport.


    Parameters

    • targetObject: default | default

      A target object to hydrate.

    • jsonObject: any

      A JSON object of a class or module method report that was previously serialized.

    Returns default | default

staticgetFormats

  • getFormats(): string[]
  • Returns the supported transform formats.


    Returns string[]

staticparse

  • parse(object: any): default
  • Deserializes a JSON object representing a ModuleMethodReport.


    Parameters

    • object: any

      A JSON object of a ModuleMethodReport that was previously serialized.

    Returns default

default

default:

Provides the aggregate report object which stores base data pertaining to a single method / function or cumulative aggregate data for a ModuleReport / ClassReport.

constructor

  • new default(lineStart?: number, lineEnd?: number, baseCyclomatic?: number): default
  • Initializes aggregate report.


    Parameters

    • optionallineStart: number

      Start line of method.

    • optionallineEnd: number

      End line of method.

    • optionalbaseCyclomatic: number

      The initial base cyclomatic complexity of the report. Module and class reports start at 0.

    Returns default

optionalaggregate

aggregate?: default

Stores any associated AggregateReport.

cyclomatic

cyclomatic: number

The cyclomatic complexity of the method / report.

cyclomaticDensity

cyclomaticDensity: number

The cyclomatic density of the method.

halstead

halstead: default

Stores the Halstead data instance.

paramCount

paramCount: number

The number of parameters for the method or aggregate report.

sloc

sloc: SLOC

The source lines of code for the method.

aggregateReport

  • get aggregateReport(): default
  • Returns the associated AggregateReport or this. Both ClassReport and ModuleReport have an aggregate AggregateReport.


    Returns default

toFormat

  • toFormat(name: string, options?: any): string
  • Formats this report given the type.


    Parameters

    • name: string

      The name of formatter to use.

    • optionaloptions: any

      (Optional) One or more optional parameters to pass to the formatter.

    Returns string

default

default:

Provides the class method report object which stores data pertaining to a single method / function.

constructor

  • new default(name?: string, paramNames?: string[], lineStart?: number, lineEnd?: number): default
  • Initializes class module method report.


    Parameters

    • optionalname: string

      Name of the method.

    • optionalparamNames: string[]

      Array of any associated parameter names.

    • optionallineStart: number

      Start line of method.

    • optionallineEnd: number

      End line of method.

    Returns default

optionalaggregate

aggregate?: default

Stores any associated AggregateReport.

cyclomatic

cyclomatic: number

The cyclomatic complexity of the method / report.

cyclomaticDensity

cyclomaticDensity: number

The cyclomatic density of the method.

errors

errors: any[]

Stores any analysis errors.

halstead

halstead: default

Stores the Halstead data instance.

lineEnd

lineEnd: number

Stores the end line for the method.

lineStart

lineStart: number

Stores the start line for the method.

maxNestedMethodDepth

maxNestedMethodDepth: number

Stores the max nested method depth.

name

name: string

The name of the method.

optionalnestedMethods

nestedMethods?: any[]

paramCount

paramCount: number

The number of parameters for the method or aggregate report.

paramNames

paramNames: string[]

Stores any parameter names.

sloc

sloc: SLOC

The source lines of code for the method.

aggregateReport

  • get aggregateReport(): default
  • Returns the associated AggregateReport or this. Both ClassReport and ModuleReport have an aggregate AggregateReport.


    Returns default

type

  • get type(): any
  • Returns the enum for the report type.


    Returns any

clearErrors

  • clearErrors(clearChildren?: boolean): void
  • Clears all errors stored in the method report.


    Parameters

    • optionalclearChildren: boolean

      (Optional) If false then nested method errors are not cleared; default (true).

    Returns void

getErrors

  • getErrors(options?: { includeChildren: boolean; includeReports: boolean; query?: any }): (default | { error: default; source: string })[]
  • Gets all errors stored in the method report and by default any nested methods.


    Parameters

    • optionaloptions: { includeChildren: boolean; includeReports: boolean; query?: any }

      Optional parameters.

    Returns (default | { error: default; source: string })[]

getName

  • getName(): string
  • Returns the name / id associated with this report.


    Returns string

toFormat

  • toFormat(name: string, options?: any): string
  • Formats this report given the type.


    Parameters

    • name: string

      The name of formatter to use.

    • optionaloptions: any

      (Optional) One or more optional parameters to pass to the formatter.

    Returns string

static_parse

  • _parse(targetObject: default | default, jsonObject: any): default | default
  • Deserializes a JSON object representing a ClassMethodReport.


    Parameters

    • targetObject: default | default

      A target object to hydrate.

    • jsonObject: any

      A JSON object of a class or module method report that was previously serialized.

    Returns default | default

staticgetFormats

  • getFormats(): any[]
  • Returns the supported transform formats.


    Returns any[]

staticparse

  • parse(object: any): default
  • Deserializes a JSON object representing a ClassMethodReport.


    Parameters

    • object: any

      A JSON object of a ClassMethodReport that was previously serialized.

    Returns default

default

default:

Provides the method report object which stores data pertaining to a single method / function.

constructor

  • new default(name?: string, paramNames?: string[], lineStart?: number, lineEnd?: number): default
  • Initializes method report.


    Parameters

    • optionalname: string

      Name of the method.

    • optionalparamNames: string[]

      Array of any associated parameter names.

    • optionallineStart: number

      Start line of method.

    • optionallineEnd: number

      End line of method.

    Returns default

optionalaggregate

aggregate?: default

Stores any associated AggregateReport.

cyclomatic

cyclomatic: number

The cyclomatic complexity of the method / report.

cyclomaticDensity

cyclomaticDensity: number

The cyclomatic density of the method.

errors

errors: any[]

Stores any analysis errors.

halstead

halstead: default

Stores the Halstead data instance.

lineEnd

lineEnd: number

Stores the end line for the method.

lineStart

lineStart: number

Stores the start line for the method.

name

name: string

The name of the method.

optionalnestedMethods

nestedMethods?: any[]

paramCount

paramCount: number

The number of parameters for the method or aggregate report.

paramNames

paramNames: string[]

Stores any parameter names.

sloc

sloc: SLOC

The source lines of code for the method.

aggregateReport

  • get aggregateReport(): default
  • Returns the associated AggregateReport or this. Both ClassReport and ModuleReport have an aggregate AggregateReport.


    Returns default

clearErrors

  • clearErrors(clearChildren?: boolean): void
  • Clears all errors stored in the method report.


    Parameters

    • optionalclearChildren: boolean

      (Optional) If false then nested method errors are not cleared; default (true).

    Returns void

getErrors

  • getErrors(options?: { includeChildren: boolean; includeReports: boolean; query?: any }): (default | { error: default; source: string })[]
  • Gets all errors stored in the method report and by default any nested methods.


    Parameters

    • optionaloptions: { includeChildren: boolean; includeReports: boolean; query?: any }

      Optional parameters.

    Returns (default | { error: default; source: string })[]

getName

  • getName(): string
  • Returns the name / id associated with this report.


    Returns string

toFormat

  • toFormat(name: string, options?: any): string
  • Formats this report given the type.


    Parameters

    • name: string

      The name of formatter to use.

    • optionaloptions: any

      (Optional) One or more optional parameters to pass to the formatter.

    Returns string

static_parse

  • _parse(targetObject: default | default, jsonObject: any): default | default
  • Deserializes a JSON object representing a ClassMethodReport.


    Parameters

    • targetObject: default | default

      A target object to hydrate.

    • jsonObject: any

      A JSON object of a class or module method report that was previously serialized.

    Returns default | default

default

default:

Provides all the averaged Halstead metric data.

@see

constructor

  • new default(): default
  • Initializes the default Halstead data.


    Returns default

bugs

bugs: number

Measures an estimate for the number of potential errors.

difficulty

difficulty: number

Measures the difficulty of the program to write or understand.

effort

effort: number

Measures the maintenance effort of the program.

length

length: number

Defines the number of operands and operators.

operands

operands: { distinct: number; total: number }

In general an operand participates in actions associated with operators. A distinct and total count of identifiers.


Type declaration

  • distinct: number
  • total: number

operators

operators: { distinct: number; total: number }

In general an operator carries out an action. A distinct and total count of identifiers.


Type declaration

  • distinct: number
  • total: number

time

time: number

Measures potential coding time.

vocabulary

vocabulary: number

Defines the unique number of operands and operators.

volume

volume: number

Measures how much information a reader of the code potential has to absorb to understand its meaning.

default

default:

Provides all Halstead metric data / parameters.

@see

constructor

  • new default(): default
  • Initializes the default Halstead data.


    Returns default

bugs

bugs: number

Measures an estimate for the number of potential errors.

difficulty

difficulty: number

Measures the difficulty of the program to write or understand.

effort

effort: number

Measures the maintenance effort of the program.

length

length: number

Defines the number of operands and operators.

operands

operands: { distinct: number; identifiers: never[]; total: number }

In general an operand participates in actions associated with operators. A distinct and total count is provided with all identifiers.


Type declaration

  • distinct: number
  • identifiers: never[]
  • total: number

operators

operators: { distinct: number; identifiers: never[]; total: number }

In general an operator carries out an action. A distinct and total count is provided with all identifiers.


Type declaration

  • distinct: number
  • identifiers: never[]
  • total: number

time

time: number

Measures potential coding time.

vocabulary

vocabulary: number

Defines the unique number of operands and operators.

volume

volume: number

Measures how much information a reader of the code potential has to absorb to understand its meaning.

reset

  • reset(clearIdentifiers?: boolean): default
  • Resets the state of all Halstead data metrics without removing any operand or operator data.


    Parameters

    • optionalclearIdentifiers: boolean

      Clears operands / operators; default: false.

    Returns default

Type Aliases

PluginConfig

PluginConfig: { instance?: string; name: string; options?: any; target?: string }

Type declaration

  • optionalinstance?: string

    Defines an existing object instance to use as the plugin.

  • name: string

    Defines the name of the plugin; if no target entry is present the name doubles as the target (please see target).

  • optionaloptions?: any

    Defines an object of options for the plugin.

  • optionaltarget?: string

    Defines the target NPM module to load or defines a local file (full path or relative to current working directory to load.

PluginData

PluginData: { managerEventPrepend: string; name: string; option: any; scopedName: string; target: string; targetEscaped: string; type: string }

Type declaration

  • managerEventPrepend: string

    The plugin manager event prepend string.

  • name: string

    The name of the plugin.

  • option: any

    Defines an object of options for the plugin.

  • scopedName: string

    The name of the plugin with the plugin managers event prepend string.

  • target: string

    Defines the target NPM module to loaded or defines a local file (full path or relative to current working directory to load.

  • targetEscaped: string

    Provides the target, but properly escaped for RegExp usage.

  • type: string

    The type of plugin: instance, require-module, or require-path.

PluginManagerOptions

PluginManagerOptions: { noEventAdd: boolean; noEventDestroy: boolean; noEventOptions: boolean; noEventRemoval: boolean; pluginsEnabled: boolean; throwNoMethod: boolean; throwNoPlugin: boolean }

Type declaration

  • noEventAdd: boolean

    If true this prevents plugins from being added by plugins:add and plugins:add:all events forcing direct method invocation for addition.

  • noEventDestroy: boolean

    If true this prevents the plugin manager from being destroyed by plugins:destroy:manager forcing direct method invocation for destruction.

  • noEventOptions: boolean

    If true this prevents setting options for the plugin manager by plugins:destroy:manager forcing direct method invocation for destruction.

  • noEventRemoval: boolean

    If true this prevents plugins from being removed by plugins:remove and plugins:remove:all events forcing direct method invocation for removal.

  • pluginsEnabled: boolean

    If false all plugins are disabled.

  • throwNoMethod: boolean

    If true then when a method fails to be invoked by any plugin an exception will be thrown.

  • throwNoPlugin: boolean

    If true then when no plugin is matched to be invoked an exception will be thrown.

SLOC

SLOC: { logical: number; physical: number }

Type declaration

  • logical: number
  • physical: number